always drop the caml lock during any xl operations
authorStefano Stabellini <sstabellini@xensource.com>
Tue, 10 Aug 2010 14:32:12 +0000 (15:32 +0100)
committerStefano Stabellini <sstabellini@xensource.com>
Tue, 10 Aug 2010 14:32:12 +0000 (15:32 +0100)
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
tools/ocaml/libs/xl/xl_stubs.c

index 8134e8eb5f036e75317d50f67a529767c1d594b3..2f8401d51709cc34fc6d632acd114743dd7b718a 100644 (file)
@@ -58,12 +58,14 @@ void log_destroy(struct xentoollog_logger *logger)
        lg.logger.vmessage = log_vmessage; \
        lg.logger.destroy = log_destroy; \
        lg.logger.progress = NULL; \
+       caml_enter_blocking_section(); \
        ret = libxl_ctx_init(&ctx, LIBXL_VERSION, (struct xentoollog_logger *) &lg); \
        if (ret != 0) \
                failwith_xl("cannot init context", &lg);
 
 #define FREE_CTX()  \
        gc_free(&gc); \
+       caml_leave_blocking_section(); \
        libxl_ctx_free(&ctx)
 
 static void * gc_calloc(caml_gc *gc, size_t nmemb, size_t size)